<%--
  Created by IntelliJ IDEA.
  User: 86158
  Date: 2024/6/21
  Time: 0:52
  To change this template use File | Settings | File Templates.
--%>
<%@ page pageEncoding="utf-8" language="java" %>
<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <title>用户信息修改</title>
    <%--    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">--%>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.1/css/all.min.css">
    <style>
        body {
            background-color: #f5f5f5;
        }

        .container {
            background-color: #fff;
            border-radius: 8px;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
            padding: 20px;
            margin-top: 50px;
            margin-bottom: 50px;
        }

        .form-group {
            margin-bottom: 20px;
        }

        .form-label {
            font-weight: bold;
        }

        .form-control {
            border-radius: 4px;
        }

        .btn-primary {
            background-color: #007bff;
            border-color: #007bff;
        }

        .btn-primary:hover {
            background-color: #0056b3;
            border-color: #0056b3;
        }

        .form-check-input {
            margin-top: 0.3rem;
        }

        .form-check-label {
            margin-left: 5px;
        }

        h4 {
            color: #666;
        }
    </style>
</head>
<body>
<%@ include file="header.jsp" %>

<div class="container">
    <h2 class="text-center mb-4"><i class="fas fa-user-edit"></i> 修改用户信息</h2>

    <form action="${pageContext.request.contextPath}/updateInfo" method="post" class="form-horizontal">

        <div class="form-group">
            <label class="col-sm-2 form-label">昵称</label>
            <div class="col-sm-3">
                <input type="text" class="form-control" name="a_name" value="${user.userName}"/>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 form-label">电话</label>
            <div class="col-sm-3">
                <input type="text" class="form-control" name="a_phone" value="${user.phone}"/>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 form-label">邮箱</label>
            <div class="col-sm-3">
                <input type="text" class="form-control" name="a_email" value="${user.email}"/>
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-2 col-form-label">性别</label>
            <div class="col-sm-10">
                <div style="display: inline-flex; align-items: center;">
                    <div style="margin-right: 10px;">
                        <input class="form-check-input"
                               style="width: 20px; height: 20px; margin-top: 0; margin-right: 5px; position: relative; top: 4px;"
                               type="radio" name="gender" id="female"
                               value="0" ${user.gender == 0 ? 'checked' : ''}>
                        <label class="form-check-label" style="font-weight: normal;">女</label>
                    </div>
                    <div style="margin-right: 20px;">
                        <input class="form-check-input"
                               style="width: 20px; height: 20px; margin-top: 0; margin-right: 5px; position: relative; top: 4px;"
                               type="radio" name="gender" id="male"
                               value="1" ${user.gender == 1 ? 'checked' : ''}>
                        <label class="form-check-label" style="font-weight: normal;">男</label>
                    </div>
                </div>
            </div>
        </div>

        <div class="form-group col-md-12 text-center">
            <input type="submit" class="btn btn-primary" value="修改信息">
        </div>


        <br>
        <br>
        <br>
        <br>
        <br>
        
        <div class="mt-4">
            <h4>${msg}</h4>
        </div>
        <input type="hidden" value="${user.userId}" name="u_id">
    </form>
</div>

<%@ include file="footer.jsp" %>
</body>
</html>
